<%--
  Created by IntelliJ IDEA.
  User: 88403
  Date: 2021/6/16
  Time: 21:55
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>预约管理</title>
    <link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css">
    <script src="http://cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
    <script src="http://cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
</head>
<body>
<%@include file="header.jsp"%>
<script type="text/javascript">
    function deleteOrder(oid){
        var res = confirm("是否删除");
        if(res==true){
            location.href="${pageContext.request.contextPath}/order/deleteOrder?oid="+oid;
        }
    }
</script>

    <div class="main-wrap">

        <div class="crumb-wrap">
            <div class="crumb-list"><i class="icon-font"></i><a href="index.jsp">首页</a><span class="crumb-step">&gt;</span><span class="crumb-name">预约管理</span></div>
        </div>

        <div class="result-wrap">

                <div class="result-title">
                    <div class="search-wrap">
                        <div class="search-content">

                                <table class="search-tab">
                                    <tr>

                                        <th width="70">关键字:</th>
                                        <td><input class="common-text" placeholder="按名字查询" id="selectorder" type="text"></td>
                                        <td><input class="btn btn-primary btn2" value="查询" type="submit" onclick="selectorder()"></td>
                                        <script>
                                            function selectorder() {
                                                var oname = $("#selectorder").val();
                                                location.href="${pageContext.request.contextPath}/order/show?oname="+oname;
                                            }
                                        </script>
                                    </tr>
                                </table>

                        </div>
                    </div>
                </div>
                <div class="result-content">
                    <table class="result-tab" width="100%">
                        <tr>
                            <th>序号</th>
                            <th>外教id</th>
                            <th>姓名</th>
                            <th>联系方式</th>
                            <th>电子邮箱</th>
                            <th>年龄</th>
                            <th>城市</th>
                            <th>需求</th>
                            <th>备注</th>
                            <th>操作</th>
                        </tr>
                        <c:forEach items="${pi.list}" var="o" varStatus="i">
                            <tr>
                                <td>${i.count}</td>
                                <td>${o.tid}</td>
                                <td>${o.oname}</td>
                                <td>${o.ophone}</td>
                                <td>${o.omail}</td>
                                <td>${o.oage}</td>
                                <td>${o.ocity}</td>
                                <td>${o.oneed}</td>
                                <td>${o.oremark}</td>

                                <td>
                                    <button onclick="deleteOrder(${o.oid})" class="btn btn-danger btn-sm">删除</button>&nbsp;&nbsp;
                                </td>
                            </tr>
                        </c:forEach>
                    </table>
                    <div class="Pages" align="center">
                        <span >目前在第<b>${pi.pageNum}</b>页,</span>
                        <span class="p_count">共有<b>${pi.pages}</b>页,</span>
                        <span class="p_total">本页共有<b>${pi.size}</b>条记录</span>
                        <span class="p_page">
                              <a href="${pageContext.request.contextPath}/order/show?pageNum=1" class="a_first">首页</a>
                           <c:if test="${pi.hasPreviousPage}">
                               <a href="${pageContext.request.contextPath}/order/show?pageNum=${pi.pageNum-1}" class="a_prev">上一页</a>
                           </c:if>
                            <c:forEach begin="1" end="${pi.pages}" var="index">
                                <c:if test="${pi.pageNum==index}">
                                    <li class="active" style="display: inline;">
                                        <a href="${pageContext.request.contextPath}/order/show?pageNum=${index}" style=" line-height: 20px;color: black; text-decoration: none;padding: 10px 10px;">${index}</a>
                                    </li>
                                </c:if>
                                <c:if test="${pi.pageNum!=index}">
                                    <li class="" style="display: inline;">
                                        <a href="${pageContext.request.contextPath}/order/show?pageNum=${index}" style=" line-height: 20px;color: black; text-decoration: none;padding: 10px 10px;">${index}</a>
                                    </li>
                                </c:if>
                            </c:forEach>

                            <c:if test="${pi.hasNextPage}">
                                <a href="${pageContext.request.contextPath}/order/show?pageNum=${pi.pageNum+1}" class="a_next">下一页</a>
                            </c:if>
                             <a href="${pageContext.request.contextPath}/order/show?pageNum=${pi.pages}" class="a_end">末页</a>
                          </span>
                    </div>
                </div>

        </div>
    </div>
    </div>

</div>
</body>
</html>
